package com.swust.exam.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swust.exam.dao.TeachersMapper;

import com.swust.exam.pojo.Teachers;

@Service
public class TeachersService {
	@Autowired
	private TeachersMapper teachersMapper;

	public Teachers get(int id) {
		return teachersMapper.selectByPrimaryKey(id);

	}
	public Teachers login(String teacherNumber, String teacherPassword){
		return teachersMapper.login(teacherNumber, teacherPassword);
	 }
	
	public List<Teachers> teacherlist(){
		return teachersMapper.teacherlist(); 
	 }

	public int delete(int id) {
		return teachersMapper.deleteByPrimaryKey(id);
	}

	public int insert(Teachers teachers) {
		return teachersMapper.insert(teachers);
	}

	public int update(Teachers teachers) {
		return teachersMapper.updateByPrimaryKey(teachers);
	}
    public int password_update(String teacherPassword,String teacherNumber){
    	return teachersMapper.password_update(teacherPassword,teacherNumber);
    }
}
